﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HardMobTopicInfo;
using System.Data.Entity.ModelConfiguration;
using HardMobCommons;
using HardMobCommons.Entidades;

namespace HardMobInfra.Mapeamentos
{
	public class UsuarioConfiguration : EntityTypeConfiguration<Usuario>
	{
		public UsuarioConfiguration()
		{
			ToTable("Usuarios");
			HasKey(u => u.ID);

			HasRequired(u => u.Topico)
				.WithMany(t => t.Usuarios)
				.Map(x => x.MapKey("TopicoID"));

			Property(u => u.Nome).IsRequired();
		}

	}
}
